﻿//
// (C) Copyright 2009 Irantha Suwandarathna (iranthas@hotmail.com)
// All rights reserved.
//

/* Copyright (c) 2001-2008, The HSQL Development Group
 * All rights reserved.
 *
 * Redistribution and use _in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions _in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer _in the documentation
 * and/or other materials provided with the distribution.
 *
 * Neither the name of the HSQL Development Group nor the names of its
 * contributors may be used to endorse or promote products derived from this
 * software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EffiProz.Core
{
    public static class StatementTypes
    {
        public const int ALLOCATE_CURSOR = 1;
        public const int ALLOCATE_DESCRIPTOR = 2;
        public const int ALTER_DOMAIN = 3;
        public const int ALTER_ROUTINE = 17;
        public const int ALTER_SEQUENCE = 134;
        public const int ALTER_TYPE = 60;
        public const int ALTER_TABLE = 4;
        public const int ALTER_TRANSFORM = 127;
        public const int CREATE_ASSERTION = 6;
        public const int CALL = 7;
        public const int CREATE_CHARACTER_SET = 8;
        public const int CLOSE_CURSOR = 9;
        public const int CREATE_COLLATION = 10;
        public const int COMMIT_WORK = 11;
        public const int CONNECT = 13;
        public const int DEALLOCATE_DESCRIPTOR = 15;
        public const int DEALLOCATE_PREPARE = 16;
        public const int DELETE_CURSOR = 18;
        public const int DELETE_WHERE = 19;
        public const int DESCRIBE = 20;
        public const int SELECT_DIRECT_SINGLE = 21;    // identifier is SELECT
        public const int DISCONNECT = 22;
        public const int CREATE_DOMAIN = 23;
        public const int DROP_ASSERTION = 24;
        public const int DROP_CHARACTER_SET = 25;
        public const int DROP_COLLATION = 26;
        public const int DROP_TYPE = 35;
        public const int DROP_DOMAIN = 27;
        public const int DROP_ROLE = 29;
        public const int DROP_ROUTINE = 30;
        public const int DROP_SCHEMA = 31;
        public const int DROP_SEQUENCE = 135;
        public const int DROP_TABLE = 32;
        public const int DROP_TRANSFORM = 116;
        public const int DROP_TRANSLATION = 33;
        public const int DROP_TRIGGER = 34;
        public const int DROP_CAST = 78;
        public const int DROP_ORDERING = 115;
        public const int DROP_VIEW = 36;
        public const int DYNAMIC_CLOSE = 37;
        public const int DYNAMIC_DELETE_CURSOR = 38;
        public const int DYNAMIC_FETCH = 39;
        public const int DYNAMIC_OPEN = 40;
        public const int SELECT_CURSOR = 85;
        public const int SELECT_SINGLE_DYNAMIC = 41;    // identifier is SELECT
        public const int DYNAMIC_UPDATE_CURSOR = 42;
        public const int EXECUTE_IMMEDIATE = 43;
        public const int EXECUTE = 44;
        public const int FETCH = 45;
        public const int FREE_LOCATOR = 98;
        public const int GET_DESCRIPTOR = 47;
        public const int HOLD_LOCATOR = 99;
        public const int GRANT = 48;
        public const int GRANT_ROLE = 49;
        public const int INSERT = 50;
        public const int MERGE = 128;
        public const int OPEN = 53;
        public const int PREPARABLE_DYNAMIC_DELETE_CURSOR = 54;
        public const int PREPARABLE_DYNAMIC_UPDATE_CURSOR = 55;
        public const int PREPARE = 56;
        public const int RELEASE_SAVEPOINT = 57;
        public const int RETURN = 58;
        public const int REVOKE = 59;
        public const int REVOKE_ROLE = 129;
        public const int CREATE_ROLE = 61;
        public const int ROLLBACK_WORK = 62;
        public const int SAVEPOINT = 63;
        public const int CREATE_SCHEMA = 64;
        public const int CREATE_ROUTINE = 14;
        public const int SELECT_SINGLE = 65;    // identifier is SELECT
        public const int CREATE_SEQUENCE = 133;
        public const int SET_CATALOG = 66;
        public const int SET_CONNECTION = 67;
        public const int SET_CONSTRAINT = 68;
        public const int SET_DESCRIPTOR = 70;
        public const int SET_TIME_ZONE = 71;
        public const int SET_NAMES = 72;
        public const int SET_PATH = 69;
        public const int SET_ROLE = 73;
        public const int SET_SCHEMA = 74;
        public const int SET_SESSION_AUTHORIZATION = 76;
        public const int SET_SESSION_CHARACTERISTICS = 109;
        public const int SET_COLLATION = 136;
        public const int SET_TRANSFORM_GROUP = 118;
        public const int SET_TRANSACTION = 75;
        public const int START_TRANSACTION = 111;
        public const int CREATE_TABLE = 77;
        public const int CREATE_TRANSFORM = 117;
        public const int CREATE_TRANSLATION = 79;
        public const int CREATE_TRIGGER = 80;
        public const int UPDATE_CURSOR = 81;
        public const int UPDATE_WHERE = 82;
        public const int CREATE_CAST = 52;
        public const int CREATE_TYPE = 83;
        public const int CREATE_ORDERING = 114;
        public const int CREATE_VIEW = 84;
        public const int ASSIGNMENT = 5;     // PSM
        public const int CASE = 86;
        public const int BEGIN_END = 12;
        public const int DROP_MODULE = 28;
        public const int FOR = 46;
        public const int IF = 88;
        public const int ITERATE = 102;
        public const int LEAVE = 89;
        public const int LOOP = 90;
        public const int RESIGNAL = 91;
        public const int REPEAT = 95;
        public const int SIGNAL = 92;
        public const int CREATE_MODULE = 51;
        public const int WHILE = 97;

        // hsqldb database
        public const int DATABASE_BACKUP = 1001;
        public const int DATABASE_CHECKPOINT = 1002;
        public const int DATABASE_SHUTDOWN = 1003;
        public const int DATABASE_SCRIPT = 1004;

        // hsqldb database settings
        public const int SET_DATABASE_DEFAULT_INITIAL_SCHEMA = 1011;
        public const int SET_DATABASE_DEFAULT_TABLE_TYPE = 1012;
        public const int SET_DATABASE_FILES_BACKUP_INCREMENT = 1013;
        public const int SET_DATABASE_FILES_CACHE_ROWS = 1014;
        public const int SET_DATABASE_FILES_CACHE_SIZE = 1015;
        public const int SET_DATABASE_FILES_DEFRAG = 1016;
        public const int SET_DATABASE_FILES_EVENT_LOG = 1017;
        public const int SET_DATABASE_FILES_LOCK = 1018;
        public const int SET_DATABASE_FILES_LOG_SIZE = 1019;
        public const int SET_DATABASE_FILES_NIO = 1020;
        public const int SET_DATABASE_FILES_READ_ONLY = 1021;
        public const int SET_DATABASE_FILES_READ_ONLY_FILES = 1022;
        public const int SET_DATABASE_FILES_SCALE = 1023;
        public const int SET_DATABASE_FILES_SCRIPT_FORMAT = 1024;
        public const int SET_DATABASE_FILES_TEMP_PATH = 1025;
        public const int SET_DATABASE_FILES_WRITE_DELAY = 1026;
        public const int SET_DATABASE_GC = 1027;
        public const int SET_DATABASE_PROPERTY = 1028;
        public const int SET_DATABASE_READ_ONLY = 1029;
        public const int SET_DATABASE_READ_ONLY_FILES = 1030;
        public const int SET_DATABASE_RESULT_MEMORY_ROWS = 1031;
        public const int SET_DATABASE_SCRIPT_FORMAT = 1032;
        public const int SET_DATABASE_SQL_COLLATION = 1033;
        public const int SET_DATABASE_SQL_IGNORECASE = 1034;
        public const int SET_DATABASE_SQL_REFERENTIAL_INTEGRITY = 1035;
        public const int SET_DATABASE_SQL_STRICT_NAMES = 1036;
        public const int SET_DATABASE_SQL_STRICT_SIZE = 1037;
        public const int SET_DATABASE_TEXT_SOURCE = 1038;
        public const int SET_DATABASE_TRANSACTION_CONTROL = 1039;
        public const int SET_DATABASE_UNIQUE_NAME = 1040;

        // hsqldb user settings
        public const int SET_USER_INITIAL_SCHEMA = 1042;
        public const int SET_USER_PASSWORD = 1043;

        // hsqldb session
        public const int TRANSACTION_LOCK_TABLE = 1044;
        public const int SET_SESSION_AUTOCOMMIT = 1045;
        public const int SET_SESSION_RESULT_MAX_ROWS = 1046;
        public const int SET_SESSION_RESULT_MEMORY_ROWS = 1047;
        public const int ROLLBACK_SAVEPOINT = 1048;

        // hsqldb schema
        public const int CREATE_ALIAS = 1051;
        public const int CREATE_INDEX = 1052;
        public const int CREATE_USER = 1053;
        public const int DECLARE_VARIABLE = 1056;
        public const int DROP_COLUMN = 1057;
        public const int DROP_INDEX = 1058;
        public const int DROP_CONSTRAINT = 1059;
        public const int DROP_USER = 1062;
        public const int EXPLAIN_PLAN = 1063;
        public const int RENAME_OBJECT = 1064;
        public const int SET_TABLE_INDEX = 1067;
        public const int SET_TABLE_READONLY = 1068;
        public const int SET_TABLE_SOURCE = 1069;
        public const int SET_TABLE_SOURCE_HEADER = 1070;
        public const int SET_TABLE_TYPE = 1071;

        // hsqldb sql implementation
        public const int CONDITION = 1101;                         // element of IF
        public const int HANDLER = 1102;
        public const int DDL = 1103;
        public const int CHECK = 1104;

        // hsqldb groups
        public const int X_SQL_SCHEMA_DEFINITION = 2001;
        public const int X_SQL_SCHEMA_MANIPULATION = 2002;
        public const int X_SQL_DATA = 2003;
        public const int X_SQL_DATA_CHANGE = 2004;
        public const int X_SQL_TRANSACTION = 2005;
        public const int X_SQL_CONNECTION = 2006;
        public const int X_SQL_CONTROL = 2007;
        public const int X_SQL_SESSION = 2008;
        public const int X_SQL_DIAGNOSTICS = 2009;
        public const int X_SQL_DYNAMIC = 2010;
        public const int X_HSQLDB_SESSION = 2011;
        public const int X_HSQLDB_SETTING = 2012;
        public const int X_HSQLDB_OPERATION = 2013;
        public const int X_HSQLDB_TRANSACTION = 2014;
        public const int X_DYNAMIC = 2015;

        // Expected types of Result returned for an SQL statement
        public const int RETURN_ANY = 0;
        public const int RETURN_COUNT = 1;
        public const int RETURN_RESULT = 2;
    }
}
